﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Ylh.Model;
using System.Data;

namespace Ylh.IDAL
{
   public interface IDepartment
    {
        /// <summary>
        /// 插入一条数据,并且放回ID号码
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="model">TbDepartment对象</param>
        /// <returns></returns>
        int InsertDepartment(string ConStr, TbDepartment model);


        /// <summary>
        /// 更新一条数据
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="model">TbDepartment对象</param>
        /// <returns></returns>
        bool UpdateDepartment(string ConStr, TbDepartment model);



        /// <summary>
        /// 判断部门名称是否存在
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="DeparName">部门名称</param>
        /// <returns></returns>
        bool IsDeParNameExists(string ConStr, string DeparName);


        /// <summary>
        /// 判断部门下面是否存在员工
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="DepartmentID">部门编号</param>
        /// <returns></returns>
        bool IsdeparmentHseStaff(string ConStr, string DepartmentID);

        /// <summary>
        /// 根据部门编号删除部门信息
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="DepartmentID">部门编号</param>
        /// <returns></returns>
        bool DeleteDepartmentInfo(string ConStr, string DepartmentID);


        /// <summary>
        /// 获取部门信息
        /// 编号如果为-1的话,将获取所有部门信息
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="DepartmentID">部门编号</param>
        /// <returns></returns>
        DataTable GetDepartMentInfo(string ConStr, decimal DepartmentID);


        /// <summary>
        /// 获取服务部门信息
        /// 两个条件同时作用
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="DepartmentID">部门ID,如果为-1则获取所有服务部门的信息</param>
        /// <param name="IsServer">
        /// true 获取服务部门
        /// false 获取非服务部门
        /// null 获取所有部门信息
        /// </param>
        /// <returns></returns>
        DataTable GetServerDepartMentInfo(string ConStr, decimal DepartmentID, bool? IsServer);


        /// <summary>
        /// 设置部门的负责人
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="staffID">负责人ID</param>
        /// <param name="DeparmentID">部门编号</param>
        /// <returns></returns>
        bool SetDeparmentHead(string ConStr, string staffID, string DeparmentID);
       
    }
}
